var floodFill = function(image,sr ,sc,newColor){
  if(image[sr][sc] === newColor){
    return image;
  }
const OldColor = image[sr][sc];
  function dfs(sr,sc){
    if(sr < 0 || sc < 0 || sr >= image.length || sc >= image[0].length || image[sr][sc] !== oldColor){
      return image;
    }
    image[sr][sc] = newColor;
    dfs(sr -1,sc);
    dfs(sr +1,sc);
    dfs(sr,sc -1);
    dfs(sr,sc +1);
  }
  dfs(sr,sc);
  return image;
}